﻿using FunArts.EasyDevOps.Shared.Models.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace FunArts.EasyDevOps.Shared.Models.SshClient.Command
{
    /// <summary>
    /// 查看安装了哪些应用的命令
    /// </summary>
    public class CheckInstalledPackageCommand:ILinuxCommand
    {
        /// <summary>
        /// 软件包名称
        /// </summary>
        public string[] PackageNames { get; set; } 

        public CheckInstalledPackageCommand(params string[] packageNames)
        {
            PackageNames = packageNames;
        }

        public string BuildCommand(SystemVersionTypeEnum systemVersionType)
        {
            return $"dpkg -l | grep -E '{string.Join('|', PackageNames)}'";
        }
    }
}
